﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace IService.Blog
{
    public interface IArticleService
    {
        #region Get

        /// <summary>
        /// 查询所有博文（分页）
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> GetAllToPage(int offset, int limit);

        /// <summary>
        /// 查询所有博文（分页--前端查询）
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> GetAllToMoer(Paging paging);

        /// <summary>
        /// 模糊查询
        /// </summary>
        /// <param name="blurCon">模糊条件</param>
        /// <returns></returns>
        public Task<MessageModel<List<BArticle>>> GetFuzzyQuery(string blurCon);

        /// <summary>
        /// 查询所有博文
        /// </summary>
        public Task<MessageModel<List<BArticle>>> GetAll();

        /// <summary>
        /// 根据条件表达式查询数据列表
        /// </summary>
        /// <param name="whereExpression">条件表达式</param>
        /// <returns>数据列表</returns>
        public Task<MessageModel<List<BArticle>>> GetByExpression<BArticle>(Expression<Func<BArticle, bool>> whereExpression);


        /// <summary>
        /// 查询博文按ID--前端
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> GetByIdToPage(int id);

        /// <summary>
        /// 查询博文按ID
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<MessageModel<BArticle>> GetById(int id);

        /// <summary>
        /// 按类别ID查询博文
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<MessageModel<List<BArticle>>> GetBySortId(int id);
        #endregion

        #region Post
        /// <summary>
        /// 添加博文
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Post(BArticle parameter);

        #endregion

        #region Put
        /// <summary>
        /// 修改博文
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Put(BArticle parameter);

        #endregion

        #region Delete
        /// <summary>
        /// 删除博文
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public Task<MessageModel<bool>> DelById(int id);

        #endregion

    }
}
